package entitys

import (
	"time"

	"github.com/jinzhu/gorm"
)

type SysOrg struct {
	EntityInfo
	Id          int32  `gorm:"primary_key" json:"orgId"`
	ParentOrgId int32  `json:"parentOrgId"`
	OrgName     string `json:"orgName"`
	Remark      string `json:"remark"`
	OrderNum    int    `json:"orderNum"`
	IsDel       int    `json:"isDel"`
}

func (SysOrg) TableName() string {
	return "sys_org"
}
func (sysOrg *SysOrg) BeforeCreate(scope *gorm.Scope) error {
	err := scope.SetColumn("CreaDtt", time.Now())
	err = scope.SetColumn("UptDtt", time.Now())
	return err
}

func (sysOrg *SysOrg) BeforeUpdate(scope *gorm.Scope) error {
	err := scope.SetColumn("UptDtt", time.Now())
	return err
}
